<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Connect to DB</title>
		<script type="text/javascript" language="javascript">
			window.onload = function() {
				document.getElementById("form").onsubmit = function() {
					var regex = /^\S+$/;
					var form = document.getElementById("form");
					var iderrormgs = document.getElementById("iderrormgs");
					var sid = form.id.value;
		
					if (!regex.test(sid)) {
						iderrormgs.textContent = "id?";
						return false;
					}
					return true;
				};
			};
		</script>
	</head>
	<body>
		<jsp:include page="/jspdemo/header.jsp" />
		<form id="form" action="/test/userOperateServlet?useroperate=findstudent" method="post">
			ID: <input type="text" name="id">
			<input type="submit" value="Find">
			<label id="iderrormgs" style="color: red"></label>
		</form>
		id:${requestScope.student.id}
		<br> name:${student.name}
	</body>
</html>